#if 0
// input: 1 1 1
// output: 1
// expected output: 0
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
using namespace std;
const int N = 55;
int cnt[N];
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    memset(cnt, 0, sizeof cnt);
    rep(i, 0, n) {
      int x;
      cin >> x;
      cnt[x]++;
    }
    int ans = 0;
    for (int s = 1; s <= 100; ++s) {
      int tot = 0;
      for (int i = 1; i < s / 2; ++i) {
        tot += min(cnt[i], cnt[s - i]);
      }
      if (s % 2 == 0)
        tot += cnt[s / 2] / 2;
      else
        tot += min(cnt[s / 2], cnt[s / 2 + 1]);
      // cout << "s=" << s << ' ' << tot << endl;

      ans = max(ans, tot);
    }
    cout << ans << endl;
  }
}

#else

#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
using namespace std;
const int N = 55;
int cnt[N];
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    memset(cnt, 0, sizeof cnt);
    rep(i, 0, n) {
      int x;
      cin >> x;
      cnt[x]++;
    }
    int ans = 0;
    for (int s = 1; s <= 100; ++s) {
      int tot = 0;
      for (int i = 1; i < s / 2; ++i) {
        tot += min(cnt[i], cnt[s - i]);
      }
      if (s % 2 == 0)
        tot += cnt[s / 2] / 2;
      else
        tot += min(cnt[s / 2], cnt[s / 2 + 1]);
      // cout << "s=" << s << ' ' << tot << endl;

      ans = max(ans, tot);
    }
    cout << ans << endl;
  }
}

#endif
